package com.yixincaipiao.ui.splash;

import android.content.Context;
import android.content.Intent;
import android.support.v4.view.ViewPager;
import android.widget.ImageView;

import com.yixincaipiao.R;
import com.yixincaipiao.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/4/25.
 */

public class WelcomeActivity extends BaseActivity {
    private static int mFromType;
    private ViewPager viewpager;

    public static void actionView(Context context, int fromType) {
        mFromType = fromType;
        context.startActivity(new Intent(context, WelcomeActivity.class));
    }

    @Override
    protected void initView() {
        setContentView(R.layout.guide_layout);
        viewpager = (ViewPager) findViewById(R.id.viewpager);
        getData();
    }

    @Override
    protected void getData() {
        List<ImageView> imageList = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            ImageView iv = new ImageView(this);
            iv.setBackgroundResource(R.mipmap.ic_launcher);
            imageList.add(iv);
        }
        GuidePagerAdater pagerAdapter = new GuidePagerAdater(imageList);
        viewpager.setAdapter(pagerAdapter);
    }
}
